package com.test.file;

import java.io.InputStream;
import java.net.URL;

public class ReadResourceDemo {

    public static void main(String[] args) throws Exception {
        ReadResourceDemo demo = new ReadResourceDemo();
        demo.demo1();
    }

    public void demo1() throws Exception {
        // 获取文件的输入流
        InputStream in = getClass().getClassLoader().getResourceAsStream("shiro.ini");
        // 获取文件的URL
        URL url = getClass().getClassLoader().getResource("shiro.ini");
        System.out.println(in.available());
        System.out.println(url.toString());
    }
}
